package com.carkeeper.service;

import com.carkeeper.dto.EmployeeDTO;
import com.carkeeper.service.serviceFallback.EmployeeFallbackFactory;
import com.carkeeper.vo.Pager;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @version : 1.0
 * @outhor : zwk
 * @data : Create in 2020-06-03
 * @description :
 */
@FeignClient(value = "carkeeper-operation",fallbackFactory = EmployeeFallbackFactory.class)
public interface EmployeeFeign {

    @GetMapping("/user")
    public Pager<EmployeeDTO> queryPage(@RequestParam(value = "pageSize", defaultValue = "10") Long pageSize,
                                        @RequestParam(value = "page", defaultValue = "1") Long page,
                                        @RequestParam(value = "id",required = false) Long id,
                                        @RequestParam(value = "username",required = false) String username,
                                        @RequestParam(value = "name",required = false) String name,
                                        @RequestParam(value = "phone",required = false) String phone,
                                        @RequestParam(value = "departmentId",required = false) Long departmentId,
                                        @RequestParam(value = "accountStatus",required = false) Integer accountStatus);

    @PostMapping("/user/list")
    List<EmployeeDTO> getUserListByIds(@RequestBody List<Long> ids);
}
